package com.tinyseed.emcp.api.maintenance.state;

import com.tinyseed.emcp.api.maintenance.domain.MaintenanceInfo;
import com.tinyseed.emcp.api.maintenance.service.MaintenanceService;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @version Revision 1.0.0
 * @版权：
 * @author: Howard
 * @email:
 * @see:
 * @创建日期：2020/3/14
 * @功能说明：已审核
 * @begin
 * @修改记录:
 * @修改后版本 修改人        修改内容
 * @2020/3/14 wuxiran        创建
 * @end
 */
@NoArgsConstructor
@Service
public class MTAuditedState extends MaintenanceState {

    public static final String AUDITED_STATE_NAME = "已审核";
    public static final String AUDITED_STATE_CODE = "AUDITED_STATE";

    @Autowired
    private MaintenanceService maintenanceService;

    @Override
    public void handleMaintenanceInfo(MaintenanceInfo context) {

    }
    @Override
    public void nextStep(MaintenanceInfo context) {
        context.setMtStatusCode(MTIssuedState.ISSUED_STATE_CODE);
        context.setMtStatus(MTIssuedState.ISSUED_STATE);

        maintenanceService.save(context);

    }
    @Override
    public void prevStep(MaintenanceInfo context) {

    }
}
